import 'package:flutter/material.dart';
import '../widgets/AppColors.dart';

class SettingItem extends StatelessWidget {
  // const SettingItem({Key? key}) : super(key: key);
  const SettingItem({super.key, required this.title, required this.image});
  final String title;
  final String image;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(14.0),
      margin: const EdgeInsets.only(left: 6, right: 6),
      decoration: BoxDecoration(
        color: AppColors.cardColor, // 背景色
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween, // 使内容两端对齐
            children: [
              Row(
                children: [
                  Image(image: AssetImage(image)),
                  const SizedBox(width: 8), // 间距,
                  Text(title,
                      style: TextStyle(
                          fontSize: 16,
                          fontWeight: FontWeight.bold,
                          color: AppColors.textPrimary)),
                ],
              ),
              const Align(
                alignment: Alignment.center,
                child:
                    Image(image: AssetImage('assets/images/setting/push.png')),
              ),
            ],
          ),
        ],
      ),
    );
  }
}
